PRA3: Harry Plotter! // Advanced

 
The devious Professor Snape has coerced young, innocent Harry Potter into organizing his potions cabinet. Snape organizes all his potions on his shelves in arrays with length P. These potions were meant to be organized by time meant to paralyze its drinker, however mischievous students ruined his collection. In order to begin organizing the potions, Harry decided to locate the index of the element in the array of potions from which the sum of elements to the left of the element equal the sum of elements to the right of the element.

Input Format

An list of integers with length N representing Snape's array of potions. The first element of the array is the first number in the list.

Sample Input

7
1
2
5
4
3
4
1

Output Format

The index (indices of an array start at 0) of the element at which the sum of elements in the array from the left of the element equals the sum of elements in the array from the right.

Sample Output

3




You must be logged in to submit a solution.